	function hideAllSelt(){
 		$("#time_selector").hide();
		$("#order_by_selector").hide();
 		$("#select_api").hide();
 		$("#show_rev").hide();
 		$("#deviceDetail").hide();
 		$("#order_selector").hide();
 		$("#event_type_selector").hide();
 		$(".addSelect").remove();
	}
	
	function fullEventType() {
		var option = '';
		
		for (var key in Event_Type){
			option += '<option value="'+key+'">'+Event_Type[key]+'</option>';
		}
		$("#event_type_selc").html('');
		$("#event_type_selc").html(option);
		$("#event_type_selector").show();
	}
	
	function apiInit(){
		if ($("#selectTable").val() == "HistyTra"){
			$("#select_api").show();
		}
		doSearch();
	}
	
	function hBaseInit(map){
		$("#show_rev").show();
		
		var thHtml = '<thead><tr>';
		for (var key in map){
			thHtml += '<th>'+map[key]+'</ th>';
		}
		thHtml += '</ tr></ thead>';
  		tBodyHtml = '<tbody id="tbody">';
  		tBodyHtml += '</ tbody>';
  		$('#dt_basic').append(thHtml+tBodyHtml);
  		doSearch();
	}
	
	function tableInit3(map){
		$("#show_rev").show();
		
		var thHtml = '<thead><tr>';
		for (var key in map){
			thHtml += '<th>'+map[key]+'</ th>';
		}
		thHtml += '</ tr></ thead>';
  		tBodyHtml = '<tbody id="tbody">';
  		tBodyHtml += '</ tbody>';
  		$('#dt_basic').append(thHtml+tBodyHtml);
  		doSearch();
	}
	
	function histyEmsInit(){
		$("#show_rev").show();
		doSearch();
	}
	
	function tableInit2(titles , map, time , order){
		$("#time_selector").show();
		$("#order_by_selector").show();
		$("#order_selector").show();
		var html = '';
		html += '<thead>';
		html += '<tr>';
		titles.forEach(function(value){
			//拼装表头
			if (map.hasOwnProperty(value)){
				html += '<td>'+ map[value] +'</ td>';
			} else {
				//如果map中没有对应值，就显示原始值
				html += '<td>'+ value +'</ td>';
			}
		});
		html += '</ tr>';
		html += '</ thead>';
		html += '<tbody id="tbody">';
		html += '</ tbody>';
		var option = '';
		order.forEach(function(value){
			option += '<option value="'+value+'">'+value+'</option>';
		});
		var timeTypeHtml = '';
		time.forEach(function(value){
			timeTypeHtml += '<option value="'+value+'">'+value+'</option>';
		});
			
		$("#dt_basic").append(html);
		$("#orderBy").html('');
  		$("#timeType").html('');
  		$("#orderBy").append(option);
  		$("#timeType").append(timeTypeHtml);
  		doSearch();
	}
	
	function newLCDaliyInit (order) {
		var order = ["data_date" , "distance"];
		var time = [];
		tableInit2(LCD_Title,LCD_Map,time,order);
		$("#time_selector").hide();
		var option = '<option class="addSelect" value="orgcode">orgcode</option>';
		$("#data_type").append(option);
	}
	
	function LctGpsMessageNewInit() {
		var time = ["createtime","sendtime","updatetime","expirationtime","schedulertime"];
		var order = ["createtime", "innerId", "imei", "cmd", "types", "content", 
		             "response","sendtime", "updatetime", "status", "failcount",
		    		"counttimes", "intervaltime", "expirationtime", "schedulertime",
		    		"sort", "addition", "source" ];
		var option = '<option class="addSelect" value="id">id</option>';
		$("#data_type").append(option);
		tableInit2(LMN_Title,LMN_Map,time,order);
	}
	
	function bindInit(){
		$("#deviceDetail").show();
		$("#order_by_selector").show();
		$("#order_selector").show();
		var html = '';
		var option = '';
		html += '<thead>';
		html += '<tr>';
		MGCL_Title.forEach(function(value){
			if (MGCL_Title_Map.hasOwnProperty(value)){
				html += '<td>'+ MGCL_Title_Map[value] +'</ td>';
			} else {
				html += '<td>'+ value +'</ td>';
			}
			option += '<option value="'+value+'">'+value+'</option>';
		});
		html += '</ tr>';
		html += '</ thead>';
		html += '<tbody id="tbody">';
		html += '</ tbody>';
		$("#dt_basic").append(html);
		$("#orderBy").html('');
		$("#orderBy").append(option);
		$("#doSearch").click(function () {
			unBindPage();
			$("#myTab").unbind();
			toPage = 1 ;
			searchCardDetail();
		});
	}
	
	function tabChange(){
		$("#myTab").click(function(){
			$('#loading').show();
			totalpage = 1;
		 	toPage = 1;
			setTimeout("searchBy()",500);
			//searchBy();
		});
	}
	
	function doSearch(){
 		$("#doSearch").click(function () {
 			unBindPage();//当再次点击搜素时，就会再次运行一个pageChange函数
 			toPage = 1 ;
 			searchBy();
 			pageChange();
 			/* $("#orderBy").change(function () {
 				searchBy();
 			}); */
 		});
	} 
	
	function pageChange(){
		$(".prev").click(function () {
 			if (toPage > 1){
 				toPage--;
 				searchBy();
 			}
	 });
	$(".next").click(function () {
		if ($("#selectTable").find("option:selected").attr('class') == "from_hBase"){
			if (!isEnd){
	 			toPage++;
	 			searchBy();
	 		} else {
	 			showEndInfo();
	 		}
		} else {
			if (toPage < totalpage){
	 			toPage++;
	 			searchBy();
	 		} else {
	 			showEndInfo();
	 		}
		}
		
	 });
	$("#dt_row").change(function () {
		if ($("#selectTable").find("option:selected").attr('class') == "from_hBase"){
			toPage = 1;
		} else {
			var pageSize = $('#dt_row').val();
	  		totalpage = Math.ceil(totalCloums/pageSize);
	  		totalpage = totalpage<=0?1:totalpage ;
			if (totalpage < toPage) {
				toPage = totalpage ;
			}
		}
		searchBy();
	});
	}
	
	function unBindPage(){
		$(".prev").unbind();
		$(".next").unbind();
		$("#dt_row").unbind();
	}
	
	function searchCardDetail(){
		$('#loading').show();
		var dataType = $("#data_type").val();
		var uncodeData = $("#imei").val();
		var data = encodeURI(encodeURI(uncodeData));
		$.ajax({
			url: "/smarttest-frontstage/CardDetail/getData.action?data="+data+"&dataType="+dataType,
		  	dataType : 'json',
		  	method:'GET',
		  	success:function(data){
		  		var result = data ;
		  		var count = result.count;
		  		var cards = result.cards;
		  		showCardDetail(count , cards);
		  		//searchBindLog();//获取当前激活的tab,搜索其绑定解绑信息
				$('#loading').hide();
				searchBy();
				pageChange();
		  	}
		  	
		});
	}
	function showCardDetail(count , cards){
		var myTab = "";
		var myTabContent = "";
		
		for (var i = 0 ; i < count ; i++){
			
			myTab += '<li>';
			var card = cards[i];
			var imei = card["gpsno"];
			myTab += '<a data-toggle="tab" href="#'+imei+'">';
			myTab += '<i class="fa fa-truck"></i>';
			myTab += '<span class="hidden-mobile hidden-tablet">';
			myTab += imei ;
			myTab += '</span>';
			myTab += '</a>';
			myTab += '</li>';
			
			myTabContent += '<div class="row tab-pane" id="';
			myTabContent += imei ;
			myTabContent += '">' ;
			var row1 = '<div class="col-sm-4 left-tab"><div class="well well-sm left-tab"><div class="bs-example"><dl class="dl-horizontal card-detail">';
			var row2 = '<div class="col-sm-4 middle-tab"><div class="well well-sm middle-tab"><div class="bs-example"><dl class="dl-horizontal card-detail">';
			var row3 = '<div class="col-sm-4 right-tab"><div class="well well-sm right-tab"><div class="bs-example"><dl class="dl-horizontal card-detail">';
			var rowArr = [row1,row2,row3];
			var flag = 0 ;
			CARD.forEach(function(key){
				var row = '';
				row += '<dt>'+ CARD_Map[key]+ '</dt>';
				if (card[key] != 'null' && card[key] != null){
					row += '<dd>'+ card[key] +'</dd>';
				} else {
					row += '<dd>'+ '&nbsp' +'</dd>';
				}
				rowArr[flag%3] += row;
				flag++;
			});
			if (CARD.length % 3 > 0){
				//如果不能被3整出，card会显示不整齐
				for(var k = 3 ; k > CARD.length % 3 ; k--){
					var row = '';
					row += '<dt>'+'&nbsp'+'</dt>';
					row += '<dd>'+'&nbsp'+'</dd>';
					rowArr[k-1] += row;
				}
			}
			rowArr.forEach(function (value,key){
				rowArr[key] += '</dl></div></div></div>';
				myTabContent += rowArr[key];
			});
			
			myTabContent += '</div>';
		}
		$("#myTab").html('');
		$("#myTabContent").html('');
		$("#myTab").html(myTab);
		$("#myTabContent").html(myTabContent);
		
		$("#myTab li:first-child").addClass("active");//默认显示第一个
		$("#myTabContent div:first-child").addClass("active");
		
	}
	
	function searchBy(){
		$('#loading').show();
		// 没注释的字段就是"冷链信息"没有的字段
		var table = $("#selectTable").val();								// 查询业务
		var dataType = $("#data_type").val();								// 数据类型
		var uncodeData = $("#imei").val();									// 设备数据
		var data = encodeURI(encodeURI(uncodeData));
		var start = $("#starttime").val();									// 开始时间
		var end = $("#endtime").val();										// 结束时间
		var pageSize = $('#dt_row').val();
		var topage = toPage;
		var timeType = $("#timeType").val();
		var orderBy = $('#orderBy').val() + " " + $('#order_sel').val();
		var apiType = $("#api_type").val();
		var reversed = $("#reversed").val();								// 排序
		var eventType = $("#event_type_selc").val();
		
		//如果是搜索绑定解绑信息，data和dataType要从#myTab中读取
		/*if($("#selectTable").val() == "Bind"){
			//由于是异步，li的状态还没改变，程序已经执行到这里了
			data = $("#myTab > li.active > a > span").html();
			dataType = "imei";
		}*/
		
		var url = "/smarttest-frontstage/"+table+"/getData.action?data="+data+"&start="+
		start+"&end="+end+"&orderBy="+orderBy+"&toPage="+topage+"&pageSize="+
		pageSize+"&timeType="+timeType+"&dataType="+dataType+"&apiType="+apiType+"&reversed="+reversed+"&eventType="+eventType ;
		
		$.ajax({
					
				  	url: url,
				  	dataType : 'json',
				  	method:'GET',
				  	success: function(data){
				  		switch ($("#selectTable").val()){
				  		case "GpsTrace" : 
				  			var timeSet = new Set(["time","createtime"]);
				  			showFromTable (data,GT_Title,timeSet) ;
				  			break;
				  		case "GpsEvent" : 
				  			var timeSet = new Set(["begintime","endtime","createtime","triggertime","updatetime"]);
				  			showFromTable (data,GE_Title,timeSet) ;
				  			break;
				  		case "HistyTra" : 
				  			showFromApi (data) ;
				  			break;
				  		case "GpsLctTrace" : 
				  			showFromHBase (data , GLT_Title_Map) ;
				  			break;
				  		case "MileageHour" : 
				  			showFromHBase (data , MH_Title_Map) ;
				  			break;
				  		case "Bind" : 
				  			var timeSet = new Set(["createtime"]);
				  			showFromTable (data,MGCL_Title,timeSet) ;
				  			break;
				  		case "HistyEms" : 
				  			showHistyEms (data) ;
				  			break;
				  		case "NewLCDaliy" : 
				  			var timeSet = new Set([]);
				  			showFromTable(data,LCD_Title,timeSet);
				  			break;
				  		case "LctGpsMessageNew" : 
				  			var timeSet = new Set(["createtime","sendtime","updatetime","expirationtime","schedulertime"]);
				  			showFromTable_LMN(data,LMN_Title,timeSet);
				  			break;
				  		case "DriverSign" : 
				  			var timeSet = new Set(["starttime","endtime","createtime","updatetime"]);
				  			showFromTable(data,DS_Title,timeSet);
				  			break;
				  		case "ColdChain" : 
				  			var timeSet = new Set(["time","createtime"]);	// 这个Set里面为是时间、需要转格式的字段
				  			showFromTable(data,CC_Title,timeSet);
				  			break;
				  		case "LiquidDetail" : 
				  			var timeSet = new Set(["time","createtime"]);	// 这个Set里面为是时间、需要转格式的字段
				  			showFromTable(data,LD_Title,timeSet);
				  			break;
				  		case "LiquidEvent" : 
				  			var timeSet = new Set(["starttime", "endtime", "createtime"]);	// 这个Set里面为是时间、需要转格式的字段
				  			showFromTable(data,LE_Title,timeSet);
				  			break;
				  		case "GpsStatus" : 
				  			var timeSet = new Set(["time"]);	// 这个Set里面为是时间、需要转格式的字段
				  			showFromTable(data,GS_Title,timeSet);
				  			break;
				  		}
				  		/*if ($("#selectTable").val() == "GpsTrace") {//
				  			var timeSet = new Set(["time","createtime"]);
				  			showFromTable (data,GT_Title,timeSet) ;
				  		}else if ($("#selectTable").val() == "GpsEvent"){//
				  			var timeSet = new Set(["begintime","endtime","createtime","triggertime","updatetime"]);
				  			showFromTable (data,GE_Title,timeSet) ;
				  		}else if ($("#selectTable").val() == "HistyTra") {//
				  			showFromApi (data) ;
				  		}else if ($("#selectTable").val() == "GpsLctTrace"){//
				  			showFromHBase (data , GLT_Title_Map) ;
				  		}else if ($("#selectTable").val() == "MileageHour")//
				  		{
				  			showFromHBase (data , MH_Title_Map) ;
				  		}else if ($("#selectTable").val() == "Bind"){//
				  			var timeSet = new Set(["createtime"]);
				  			showFromTable (data,MGCL_Title,timeSet) ;
				  		}else if ($("#selectTable").val() == "HistyEms"){
				  			showHistyEms (data) ;
				  		} else if ($("#selectTable").val() == "NewLCDaliy") {
				  			var timeSet = new Set([]);
				  			showFromTable(data,LCD_Title,timeSet);
				  		}*/
				  	}
				});
	}
	
	
	function showFromTable (data,arr,timeSet) {
		
		$('.dataTables_info').html('');
		$('#tbody').html('');
		totalCloums = data.total;
		if (totalCloums > 0){
			var pageSize = $('#dt_row').val();
	  		totalpage = Math.ceil(totalCloums/pageSize);
	  		totalpage = totalpage<=0?1:totalpage ;
	  		
  			var item = data.rows;
	  		var tdHtml = '';
	  		item.forEach(function (row){
	  			tdHtml += '<tr>';
	  			arr.forEach(function(key){
	  				if (row[key] == null){
	  					tdHtml += '<td></ td>';
	  				}else if (timeSet.has(key)){
	  					var tdDate = row[key];
		  				var timelong = parseInt(tdDate);
		  				tdHtml += '<td>'+new Date(timelong).Format("yyyy-MM-dd hh:mm:ss")+'</ td>';
		  				
	  				}else{
	  				tdHtml += '<td>'+row[key]+'</ td>';
	  				}
	  			});
	  			tdHtml += '</ tr>';
	  		});
	  		//$('#tbody').html('');
	  		$('#tbody').append(tdHtml);
	  		
	  		if($("#ofix3_div_head") != []){
	  			$("#ofix3_div_head").remove();
	  		}
	  		var ofix1 = new oFixedTable('ofix3', document.getElementById('dt_basic'), {rows:1});
	  		
	  		$("#dt_basic").freezeHeader();
	  		var infoHtml = '当前第'+toPage+'页 ';
	  		var from = pageSize*(toPage-1)+1;
	  		var to = pageSize*toPage;
	  		infoHtml += ' 从 '+from+' 到 '+to+' / 共 '+totalCloums+' 条数据';
	  		
	  		//$('.dataTables_info').html('');
	  		$('.dataTables_info').html(infoHtml);
		}
		$('#loading').hide();
	}
	
	function showHistyEms (data) {
		isEnd = true ;
		$('#tbody').html('');
		$('.dataTables_info').html('');
		if (0 == data.result){
	  		var pageSize = $('#dt_row').val();
			var item = data.dataList;
			if (item.length == pageSize) {
				isEnd = false ;
			} else {
				showEndInfo();
			}
			var item = data.dataList;
  			var titleSet = getTitleSet ( item ) ;
  			var sortTitleArray = getSortTitle(titleSet);
  			var thHtml = '<thead><tr>';
  			var tdHtml = '<tbody>';// <div style="overflow:scroll">
  	  			
			for (var x in item) {
  	  			tdHtml += '<tr>';
  	  			sortTitleArray.forEach(function(key){
  	  				if (0 == x) {
		  	  			if(ZH_TO_CH.hasOwnProperty(key)){
		  	  				thHtml += '<th>'+ZH_TO_CH[key]+'</ th>';
		  	  			} else {
		  	  				thHtml += '<th>'+key+'</ th>';
		  	  			}
  	  				}
  	  				var tdVal = '' ;
  	  				if (item[x].hasOwnProperty(key)){
  	  					if (item[x][key] != null){
  	  						tdVal = item[x][key] ;
  	  					}
  	  				}
  	  				tdHtml += '<td>'+tdVal+'</ td>';
  	  			});
  				tdHtml += '</ tr>';
  			}
			thHtml += '</ thead></ tr>';
			tdHtml += '</ tbody>';//</ div> 
	  		//$('#tbody').html('');
			$("#dt_basic").html(thHtml+tdHtml);
	  		if($("#ofix3_div_head") != []){
	  			$("#ofix3_div_head").remove();
	  		}
	  		var ofix1 = new oFixedTable('ofix3', document.getElementById('dt_basic'), {rows:1});
	  		$("#dt_basic").freezeHeader();
	  		var infoHtml = '当前第'+toPage+'页 ';
	  		//$('.dataTables_info').html('');
	  		$('.dataTables_info').html(infoHtml);
		}
		$('#loading').hide();
	}
	
	function showFromApi (data) {
		$('#tbody').html('');
		$("#dt_basic").html('');
		$('.dataTables_info').html('');
		if (0 == data.result) {
  			totalCloums = data.total;
	  		var pageSize = $('#dt_row').val();
	  		totalpage = Math.ceil(totalCloums/pageSize);
	  		totalpage = totalpage<=0?1:totalpage ;
	  		
  			var timeSet = new Set(["time","createTime","endTime","startTime","createDate","updateTime","stoptime","stopTime"]);
  			
  			var item = data.dataList;
  			var titleSet = getTitleSet ( item ) ;
  			var sortTitleArray = getSortTitle(titleSet);
  			var thHtml = '<thead><tr>';
  			var tdHtml = '<tbody>';// <div style="overflow:scroll">
  	  			
			for (var x in item) {
  	  			tdHtml += '<tr>';
  	  			sortTitleArray.forEach(function(key){
  	  			if (0 == x) {
  					if(ZH_TO_CH.hasOwnProperty(key)){
  						thHtml += '<th>'+ZH_TO_CH[key]+'</ th>';
  					} else {
  						//暂时用英文代替
  						thHtml += '<th>'+key+'</ th>';
  					}
  					
  				}
  				if(key=="HKMFuelEconomy"){
  					if (item[x]["travelFuelEconomy"] > 0 && item[x]["milage"] > 0){
  						var hkmf = (100 * (item[x]["travelFuelEconomy"]) / item[x]["milage"]).toFixed(2);
  						tdHtml += '<td>'+hkmf+'</ td>';
  					} else if(item[x]["totalOil"] > 0 && item[x]["totalDistance"] > 0){
  						var hkmf = (100000 * (item[x]["totalOil"]) / item[x]["totalDistance"]).toFixed(2);
  						tdHtml += '<td>'+hkmf+'</ td>';
  					} else {
  						tdHtml += '<td>'+"0"+'</ td>';
  					}
  				} else if (timeSet.has(key)) {
  					//将含time的字段转换为时间格式
  					var timelong = parseInt(item[x][key]) ;
					tdHtml += '<td>'+new Date(timelong).Format("yyyy-MM-dd hh:mm:ss")+'</ td>';
		  				
  				} else {
  					var tdVal = '' ;
  					if (item[x].hasOwnProperty(key)){
  						if (item[x][key] != null){
  						tdVal = item[x][key] ;
  						}
  					}
  					tdHtml += '<td>'+tdVal+'</ td>';
	  			} 
  	  			});
  				
  				tdHtml += '</ tr>';
  			}
			thHtml += '</ thead></ tr>';
			tdHtml += '</ tbody>';//</ div> 
	  		//$('#tbody').html('');
	  		//$('#tbody').append(tdHtml);
	  		//$("#dt_basic").html('');
	  		$("#dt_basic").html(thHtml+tdHtml);
	  		if($("#ofix3_div_head") != []){
	  			$("#ofix3_div_head").remove();
	  		}
	  		var ofix1 = new oFixedTable('ofix3', document.getElementById('dt_basic'), {rows:1});
	  		
	  		$("#dt_basic").freezeHeader();
	  		var infoHtml = '当前第'+toPage+'页 ';
	  		var from = pageSize*(toPage-1)+1;
	  		var to = pageSize*toPage;
	  		infoHtml += ' 从 '+from+' 到 '+to+' / 共 '+totalCloums+' 条数据';
	  		
	  		//$('.dataTables_info').html('');
	  		$('.dataTables_info').html(infoHtml);
  		}
  		$('#loading').hide();
	}
	
	
	function showFromHBase (data , map) {
		isEnd = true ;
		$('#tbody').html('');
		$('.dataTables_info').html('');
		if (0 == data.result){
	  		var pageSize = $('#dt_row').val();
			var item = data.dataList;
			if (item.length == pageSize) {
				isEnd = false ;
			} else {
				showEndInfo();
			}
	  		var tdHtml = '';
	  		item.forEach(function(row){
	  			tdHtml += '<tr>';
	  			for(var key in map){
	  				if (row.hasOwnProperty(key) && row[key] != null){
	  					tdHtml += '<td>'+row[key]+'</ td>';
	  				} else {
	  					tdHtml += '<td> </ td>';
	  				}
	  			}
	  			tdHtml += '</ tr>';
	  		});
	  		
	  		//$('#tbody').html('');
	  		$('#tbody').append(tdHtml);
	  		if($("#ofix3_div_head") != []){
	  			$("#ofix3_div_head").remove();
	  		}
	  		var ofix1 = new oFixedTable('ofix3', document.getElementById('dt_basic'), {rows:1});
	  		
	  		$("#dt_basic").freezeHeader();
	  		var infoHtml = '当前第'+toPage+'页 ';
	  		//$('.dataTables_info').html('');
	  		$('.dataTables_info').html(infoHtml);
		}
		
		
		$('#loading').hide();
	}
	
	
	function  getSortTitle(titleSet) {

		var sortTitleArray = [];
		//如果titleSet中同时存在travelFuelEconomy与allMilage，则推入"HKMFuelEconomy"
		var inEms = titleSet.has("travelFuelEconomy") && titleSet.has("milage");
		var inCan = titleSet.has("totalOil") && titleSet.has("totalDistance");//can与volvo里的总油耗与总里程相同
		if(inEms || inCan){
			sortTitleArray.push("HKMFuelEconomy");
		}
		for(var key in SORT_TITLE){
			var sortKey = SORT_TITLE[key];
			var value = titleSet.delete(sortKey);
			if(value != null && value != undefined && value){
				sortTitleArray.push(sortKey);
			}
		}
		titleSet.forEach(function(key){
			sortTitleArray.push(key);
		});
		/*for (var key of titleSet) {
			sortTitleArray.push(key);
		}*/
		return sortTitleArray ;
	}
	
	
	function getTitleSet (item) {
		var set = new Set();
		for (x in item) {
			for (key in item[x]) {
				set.add(key) ;
			}
		}
		return set ;
	}
	
	function showEndInfo () {
		$('#reach_end').show();
		setTimeout("$('#reach_end').hide();",3000);
	}
	

	//指令下发要翻译types与status中的内容，比较特殊，重新做一个
function showFromTable_LMN (data,arr,timeSet) {
		
		$('.dataTables_info').html('');
		$('#tbody').html('');
		totalCloums = data.total;
		if (totalCloums > 0){
			var pageSize = $('#dt_row').val();
	  		totalpage = Math.ceil(totalCloums/pageSize);
	  		totalpage = totalpage<=0?1:totalpage ;
	  		
  			var item = data.rows;
	  		var tdHtml = '';
	  		item.forEach(function (row){
	  			tdHtml += '<tr>';
	  			arr.forEach(function(key){
	  				if (row[key] == null){
	  					tdHtml += '<td></ td>';
	  				}else if (timeSet.has(key)){
	  					var tdDate = row[key];
		  				var timelong = parseInt(tdDate);
		  				tdHtml += '<td>'+new Date(timelong).Format("yyyy-MM-dd hh:mm:ss")+'</ td>';
		  				
	  				} else if (key == 'status') {
	  					var status = LMN_Map_Status[row[key]]!='undefined' && LMN_Map_Status[row[key]] != null?LMN_Map_Status[row[key]]:row[key];
	  					tdHtml += '<td>'+row[key]+":"+status+'</ td>';
	  				}else{
	  				tdHtml += '<td>'+row[key]+'</ td>';
	  				}
	  			});
	  			tdHtml += '</ tr>';
	  		});
	  		//$('#tbody').html('');
	  		$('#tbody').append(tdHtml);
	  		
	  		if($("#ofix3_div_head") != []){
	  			$("#ofix3_div_head").remove();
	  		}
	  		var ofix1 = new oFixedTable('ofix3', document.getElementById('dt_basic'), {rows:1});
	  		
	  		$("#dt_basic").freezeHeader();
	  		var infoHtml = '当前第'+toPage+'页 ';
	  		var from = pageSize*(toPage-1)+1;
	  		var to = pageSize*toPage;
	  		infoHtml += ' 从 '+from+' 到 '+to+' / 共 '+totalCloums+' 条数据';
	  		
	  		//$('.dataTables_info').html('');
	  		$('.dataTables_info').html(infoHtml);
		}
		$('#loading').hide();
	}
	
	
	/*function tableInit(){
	$("#time_selector").show();
	$("#order_by_selector").show();
	$('#loading').show();
	var table = $("#selectTable").val();
	
	$.ajax({
	  	url: "/smartop-frontstage/"+table+"/getTitle.action",
	  	dataType : 'json',
	  	method:'GET',
	  	success: function(data){
	  		$('#loading').hide();
	  		var th = data;
	  		var option = '';
	  		var thHtml = '<thead><tr>';
	  		var timeTypeHtml = '';
	  		for(x in th){
	  			option += '<option value="'+th[x]+'">'+th[x]+'</option>';
	  			thHtml += '<th>'+th[x]+'</ th>';
	  			if (-1 != th[x].search(/time/i)) {
	  				timeTypeHtml += '<option value="'+th[x]+'">'+th[x]+'</option>';
	  			}
	  		}
	  		thHtml += '</ tr></ thead>';
	  		tBodyHtml = '<tbody id="tbody">';
	  		tBodyHtml += '</ tbody>';
	  		$("#orderBy").html('');
	  		$("#timeType").html('');
	  		$("#orderBy").append(option);
	  		$('#dt_basic').append(thHtml+tBodyHtml);
	  		$("#timeType").append(timeTypeHtml);
	  	}
	});
}*/

	